package com.mkyong.common.service.impl;

import java.util.Collection;

import com.mkyong.common.model.Question;
import com.mkyong.common.repository.dao.QuestionDao;
import com.mkyong.common.service.QuestionService;

public class QuestionServiceImpl implements QuestionService {

    protected QuestionDao questionDao;

    public QuestionServiceImpl() {
    }

    public void createQuestion(Question question) {
        questionDao.save(question);
    }

    public QuestionDao getQuestionDao() {
        return questionDao;
    }

    public void setQuestionDao(QuestionDao questionDao) {
        this.questionDao = questionDao;
    }

    @Override
    public Question getQuestionById(long questionId) {
        // TODO Auto-generated method stub
        return questionDao.getQuestionById(questionId);
    }

    @Override
    public void modifyQuestion(Question question) {
        questionDao.modifyQuestion(question);
    }

    @Override
    public Collection<Question> sortQuestions(String sort) {
        return questionDao.sortQuestions(sort);
    }

}
